package com.harvey.metrics.metric.gauge;

import com.codahale.metrics.ConsoleReporter;
import com.codahale.metrics.MetricRegistry;

import java.util.concurrent.TimeUnit;

/**
 * @author harvey
 * @Description 对外监控JMX的内容
 * 【可以指定监控的JMX连接的信息，通过获取第三方提供的MBean 】
 * @date 2020-04-08 17:07
 * @since
 */

@Deprecated
public class JmxAttributeGaugeExample {

    private static final MetricRegistry registry = new MetricRegistry();

    private static final ConsoleReporter reporter = ConsoleReporter.forRegistry(registry)
            .convertRatesTo(TimeUnit.SECONDS)
            .convertDurationsTo(TimeUnit.SECONDS)
            .build();

    public static void main(String[] args) {

        reporter.start(10, TimeUnit.SECONDS);

//        registry.register(MetricRegistry.name(JmxAttributeGaugeExample.class, "HeapMemory"), new Gauge<>() {
//        })
    }

}
